package kryptologieBlatt1;
import javax.swing.SwingUtilities;


public class DecipherVigenereChiffre {
	
	Vigenere vigenereChiffre;
	
	public DecipherVigenereChiffre() {
	}
	
	private void initVariable() {
		vigenereChiffre = new Vigenere();
	}
	
	public void decipherChiffre(String chiffreText){
		initVariable();
		String plainText = vigenereChiffre.tryToDecodeChiffre(chiffreText);
		System.out.println(plainText);
	}
	
	public void drawLetterFrequency(String chiffreText){
		initVariable();
		vigenereChiffre.drawFrequency(chiffreText, 1000, 500);
	}
	
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				String chiffre = "CUXIPWAORMZVMOLISNIYPVVHDQUSVXNHGICT" +
						"RXYYRBRRPRVOWASVMLPFRSRPGPYQAIGOVDZR" +
						"CIYNHUSPBAORWORCWEGVMLEFBDDOSZRICOHC" +
						"JTBQORHOFKYQSVXICQBWTFHRBXLGGKXFFTOW" +
						"NVESIMSAGMCRVXHPAZKRRSAKYKIUYICHSYVD" +
						"QUOVOSEKFESVVYYUSEICQBWTFHRBATGFORDQ" +
						"UKJERRBYYWIOVDWGISQQNVMQCEXMLWALICYR" +
						"VIJVNLIYOHPITBRCMNVRBLPWGCPFSPUISWAQ" +
						"IHWRCIYRVOXLGGKXFFRSRROOORQIRBEFGFOR" +
						"DHRRIYRRJYRORXKWWPRQLQUDHTSZOXSCQOFP" +
						"FHRXLISOMYSEKRLZLCIOSEQICOREWNVRNMPP" +
						"RSQEWCZIYURWENVGGICRRXNPRRDEDHRFICIE" +
						"CENVGOMYZRSGSHNXHPFRCKPFNOYDQUNEDOHP" +
						"HPBTOXTDCDIYPHMLDHNLIYVVXAPWFD";
				DecipherVigenereChiffre dV = new DecipherVigenereChiffre();
				dV.decipherChiffre(chiffre);
				dV.drawLetterFrequency(chiffre);
			}
		});
	}

}
